












<!doctype html>


<html lang="zh-cn">
<head>

	<meta charset="UTF-8">
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Pragma" content="no-cache" />
	<title>
	  
  	  	登录红蚂蚁机构个人中心
  	  
	</title>
<link rel="stylesheet" type="text/css" href="css/login.css?version=20161019">
	<link rel="stylesheet" type="text/css" href="css/nav.css">
	<link rel="stylesheet" type="text/css" href="css/footer.css">
	<link rel="stylesheet" type="text/css" href="css/ui-dialog.css">
	<script src="script/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="script/jquery.flexslider-min.js"></script>
	<script type="text/javascript" src="script/jquery.DB_springMove.min.js"></script>
	<script src="script/artDialog/dialog-min.js?version=20161018"></script>
	<script src="script/login.js?version=20161018"></script>
	<meta name="author" content="Piaoyis,me@piaoyis.com" >
	<script type="text/javascript">
	var contextPath="";
	$(function(){
    	$.ajax({
    		url: contextPath+"/checkLogin.action",
    		type: "POST",
    		success: function(data){
    			if(data != null){
    				var dataArr = data.split(",");
    				$("#currentTime").val(dataArr[0]);
    				$("#codeSign").val(dataArr[1]);
    			} 
    		}
    	});
    	
    });
// 	//百度统计代码 （2016-06-22新增）
// 	var _hmt = _hmt || [];
// 	(function() {
// 		var hm = document.createElement("script");
// 		hm.src = "//hm.baidu.com/hm.js?042f1b4fd18a22ee217f0673c4c1b92f";
// 		var s = document.getElementsByTagName("script")[0];
// 		s.parentNode.insertBefore(hm, s);
// 	})();
	</script>
</head>
<body>
 


<style type="text/css">
		.son_demo{ position: absolute; left: 0px; top: 0px; z-index: 999;}
		.wrap_foo{ margin-top: 0px;}
	</style>
<!-- nav 开始 -->
	<div class="wrap_nav son_demo">
		<div class="nav_cen son_cen">
			<div class="nav_logoson"></div>
			<ul class="nav_secen"> 
			 
				<li><a href='http://www.sunlands.com' target="_blank">首页</a></li>
				<!-- <li><a href="http://www.sunlands.com" target="_blank">首页</a></li> -->
				<li><a href="http://gw.sunlands.com/category/indexWebCategory.htm" target="_blank">全部课程</a></li>
				<li><a href="http://gw.sunlands.com/tiku/indexWebTiku.htm" target="_blank">免费题库</a></li>

			 
			</ul>
		</div>
	</div>
	<!-- nav 结束 -->
 
	<form  id="registorForm" method="post">
	<input type="hidden" value="" id="currentTime" />
	<input type="hidden" value="" id="codeSign" />
	<div id="registorDiv" class="free_wrap an_hide reg_free_wrap">
		<div class="modify_register modify_singleTit">
			<h1>注册红蚂蚁账号</h1>
		</div>
		
		<div class="case_wrap mix_hee">
		<div class="registorError"><span></span><img src="/images/pic31.gif"></div>
			<div class="case_son modify_case_son">
				<h3><i class="iconfont">&#xe601;</i></h3>
				<input type="text" id="mobile" name="mobile" class="son_in pas" placeholder="输入手机号" maxlength="11" autocomplete="off"/>
				<a class="porIcon iconfont" href="javascript:;">&#xe606;</a>
			</div>
			<div class="case_son modify_case_son res_addMar">
				<h3><i class="iconfont">&#xe605;</i></h3>
				<div class="entry_wrap">
					<input type="text" id="code" name="code" placeholder="输入验证码" maxlength="4"  class="pas" autocomplete="off"/>
				</div>
				<div class="cover"></div>
				<div class="gain">获取验证码</div>
			</div>
			<div class="case_son bor_no modify_case_son">
				<h3><i class="iconfont">&#xe602;</i></h3>
				<input id="pswd" name="passwd" class="son_in pas" placeholder="· · · · · · · · ·" autocomplete="off"  onfocus="this.type='password'"/>
			</div>
			
		</div>
		<button id="registorBtn" class="free_btn">免费注册</button>
		<h2 id="toLogin">已有账号，<a href="javascript:void(0);">立即登录</a></h2>
	</div>
</form>

	<!-- 登录账号 -->

	<div id="loginDiv" class="enter_wrap  modify_enter_wrap">
		<div class="clearfix">
			<div class="modify_doubleTit">
				<h1 class="current"><span>账号登录</span></h1>
				<h1><span>微信扫码登录</span></h1>
			</div>
			<div class="modify_singleTit modify_none">
				<h1 class="modify_none">
					<span>手机号绑定</span>
					<span class="littleSize">绑定手机号以便下次快速登录</span>
				</h1>
				<h1 class="modify_none">您未在红蚂蚁机构注册过</h1>
				<h1 class="modify_none">您已在红蚂蚁机构注册过</h1>
			</div>
		</div>
		
		<!-- 登录 -->
		<div class="changeTab" id="loginUserDiv">
				<form id="loginForm" class="fm-v clearfix" action="/login;jsessionid=A2ED18BC6D3EA34C30BA892FAB13BF68?service=http%3A%2F%2Fyi.sunlands.com%2Fent-portal-war%2Fspa%2Fjs%2Flib%2Fdialog.js" method="post">
			<div class="case_wrap mix_he">
				<h5><img src="/images/pic31.gif"><span></span></h5>
					 
						<input type="hidden" name="lt" value="LT-40907240-7naay3R9AMpyvmWCvehc7MvkJedDYj" />
						<input type="hidden" name="execution" value="e1s1" />
						<input type="hidden" name="_eventId" value="submit" />
				<div class="case_son modify_case_son">
					<h3><i class="icon iconfont">&#xe601;</i></h3>
					
					
					
						
						<input id="telphone" name="username" tabindex="1" placeholder="手机号" class="son_in" accesskey="n" type="text" value="" size="25" maxlength="11" autocomplete="false"/>
					
					<a class="porIcon iconfont" href="javascript:;">&#xe606;</a>
				</div>
				<div class="case_son bor_no modify_case_son">
					<h3><i class="iconfont">&#xe602;</i></h3>
					
					<input id="password" name="password" tabindex="2" placeholder="密码" class="son_in pas" accesskey="p" type="password" value="" size="25" autocomplete="false"/>
				</div>
			</div>
			<div class="rianle">
				<span><a href="/showForgetPage.action" style="color:#606060">忘记密码?</a></span>
				<label><input type="checkbox" name="rememberMe" id="rememberMe" value="" />自动登录</label>
			</div>
			<input type="hidden" name="sign" id="sign" value=""/>
			<input type="hidden" name="isgw" id="isgw" value=""/>
			<input id="msgBtn" accesskey="l" value="立即登录" tabindex="3" type="submit"  class="immediately_btn" tabindex="3" />
			</form>
		
			<h2 id="toRegistor">还没有账号？<a href="javascript:void(0);">免费注册</a></h2>
		</div>
		
		<!-- 二维码 -->
		<div class="changeTab add_codeMa modify_none">
			<img id="imgQr" />
			<div class="modify_mask modify_loading modify_none">
				<img src="/cas/images/gin4.png" />
			</div>
			<div class="modify_mask modify_codeFail modify_none">
				<p>二维码已失效</p>
				<a href="javascript:void(0);" id="refreshCode">刷新二维码</a>
			</div>
		</div>
		<input type="hidden" value="" id="ticket" />
		<!-- 手机号绑定/已在红蚂蚁注册过 -->
		<div class="changeTab modify_none phoneNum modify_mix_he">
			<!-- <p><span id="tips" style="color:red;"></span></p> -->
			<h5 id="tips" style="display: none;"><img src="/cas/images/pic31.gif"><span></span></h5>
			<div class="case_wrap mix_he modify_bindOne changeMarTop">
				
					<div class="case_son modify_case_son">
						<h3><i class="iconfont">&#xe601;</i></h3>
						<input class="son_in" value="" placeholder="手机号" id="bindingMobile"/>
					</div>
					<input class="immediately_btn" id="nextBtn" value="下一步" type="button" />
				
			</div>
			<div class="case_wrap mix_he modify_bindOne changeMarTop modify_none ">
					<div class="case_son modify_case_son">
						<h3><i class="iconfont">&#xe601;</i></h3>
						<input class="son_in" value="" placeholder="手机号" />
					</div>
					<div class="case_son modify_case_son">
						<h3><i class="iconfont">&#xe602;</i></h3>
						<input type="password" class="son_in" value="" placeholder="密码" />
					</div>
					<div class="rianle">
						<label><input type="checkbox" name="rememberMe" id="rememberMe" value="">自动登录</label>
					</div>
					<input class="immediately_btn" value="绑定并登录" type="button" id="bindingBtn"/>
			</div>
		</div>

		<!-- 未在红蚂蚁注册过 -->
		<div class="changeTab modify_none">
			<div class="case_wrap mix_he modify_bindTwo">
				<form>
					<div class="case_son modify_case_son">
						<h3><span><img src="/cas/images/gin2.png"></span></h3>
						<input class="son_in" value="" placeholder="手机号" />
					</div>
					<div class="case_son modify_case_son">
						<h3><span><img src="/cas/images/gin3.png"></span></h3>
						<div class="entry_wrap">
							<input type="text" id="code" name="code" placeholder="输入验证码" maxlength="4" class="pas" autocomplete="off">
						</div>
						<div class="cover"></div>
						<div class="gain">获取验证码</div>
					</div>
					<div class="case_son bor_no modify_case_son">
						<h3><span><img src="/cas/images/gin4.png"></span></h3>
						<input  class="son_in pas" placeholder="密码" type="password" value="" />
					</div>
					<div class="rianle">
						<label><input type="checkbox" name="rememberMe" id="rememberMe" value="">自动登录</label>
					</div>
					<input class="immediately_btn" value="注册并绑定" type="submit" />
				</form>
			</div>
		</div>
	</div>

	
	<!-- 轮播 -->
	<div class="flexslider">
		<ul class="slides">
			<li style="background: url(/images/index.png) 50% 0px no-repeat;"></li>
		</ul>
	</div>
 

<style type="text/css">
		.son_demo{ position: absolute; left: 0px; top: 0px; z-index: 999;}
		.wrap_foo{ margin-top: 0px;}
		.boy_ri a{color:#7d7d7d;margin-bottom:0}
	</style>
<div class="wrap_foo">
		<div class="footer_cen">
			<h1>红蚂蚁机构，学习是一种信仰!</h1>
			<div class="body_cen" style="width: 800px;">
				 
				<div class="boy_le">
					<ul>
						<li><a href='#' target="_blank" >关于红蚂蚁</a></li>
<!-- 						<li><a href="javascript:;">隐私条款</a></li> -->
<!-- 						<li><a href="javascript:;">联系我们</a></li> -->
						<li><a href='#' target="_blank">法律声明</a></li>
<!-- 						<li><a href="javascript:;">帮助中心</a></li> -->
						<li><a href="#" target="_blank">红蚂蚁新闻</a></li>
						<li><a href="#" target="_blank">红蚂蚁媒体</a></li>
						<li><a href="#" target="_blank">加盟招商</a></li>
					</ul>
					
					<h2>友情链接</h2>
					<ol>
						<li><a href="http://www.duia.com" target="_blank">对啊网</a></li>
						<li><a href="http://www.haixue.com" target="_blank">嗨学网</a></li>
					</ol>
				</div>
				<div class="boy_ri" style="margin-left:20px;width:420px;float:left;">
					<p><a target="_blank" href="http://gw.sunlands.com/copyright/rights.htm" style="color:#939393;">Copyright ©2013-2017 北京红蚂蚁在线教育科技有限公司,All Rights Reserved</a></p>
					<p>
						<a href="http://www.miitbeian.gov.cn/state/outPortal/loginPortal.action" target="_blank" style="color:#939393;">京ICP备14002947号-3</a>
					</p>
<!-- 					<p><a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502031798" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img src="" style="float:left;"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">京公网安备 11010502031798号</p></a></p> -->
<!-- 					<p><a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502031798" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;"><img src="http://static.sunlands.com/user_center/icon-police.png" style="float:left;  margin-top:0px;"/>京公网安备 11010502031798号</p></a></p> -->
					<p>
						<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502031798" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;color:#939393;"><img src="http://static.sunlands.com/user_center/icon-police.png" style="float:left;margin-top:0px"/>&nbsp;&nbsp;京公网安备 11010502031798号</a>
					</p>
					<div class="brand">
					<span
						style="display: inline-block; position: relative; width: auto;"><a
						style="display: inline-block;" kx_type="图标式" target="_blank"
						tabindex="-1" id="kx_verify"
						href="https://ss.knet.cn/verifyseal.dll?sn=e14102111010755254vsze000000&amp;ct=df&amp;a=1&amp;pa=0.5568104213733962"
						target="_blank"><img alt="可信网站" oncontextmenu="return false;"
							style="border: none; border-radius: 6px;"
							src="http://rr.knet.cn/static/images/logo/cnnic.png"></a></span>
				</div>
				</div>
   				
			</div>

		</div>

	</div>

	<input type="hidden" value='#' id="url" />



<!-- 完成绑定！下次可以微信扫码直接登录的提示弹窗 -->
<div class="add_bidMask modify_none">
	<div>
		<p><img src="/cas/images/gin4.png" /></p>
		<div>
			<p>完成绑定！下次可以微信扫码直接登录</p>
			<span>2秒后登录…</span>
		</div>
	</div>
</div>
</body>
<script type="text/javascript">

/*点击取消，手机号为空*/
$(".porIcon").click(function() {
    $(this).prev("input").val("");
});

/*点击input框，图标变色*/
$(".son_in").focus(function(){
	$(this).siblings().find("i").addClass("iconOrg");
})
$(".son_in").blur(function(){
	$(this).siblings().find("i").removeClass("iconOrg");
});


$("#toLogin").click(function(){
	$(".registorDiv").addClass("rotateAnimate");
	setTimeout(function() {
		$(".registorDiv").addClass("rotateAnimate");
	});
});


$(".modify_bindTwo .case_son .gain").click(function() {
	var count = 5;
	var _this = $(this);
	var time = setInterval(function() {
		_this.text(count+"秒后重发");
		console.log(count);
		if(count == 0) {
			_this.text("获取验证码").css("background","#FE6600");	 
			clearInterval(time);
			
		}
		count--;
	},1000);
	$(this).css({
		"background":"#ccc",
		"color":"#fff"
	});
});

$("#refreshCode").click(function(){
	count = 60;
	createCode();
});

/*生成二维码*/
var loginTime;
function createCode(){
	
	if(loginTime == null){
		$.ajax( {
			type : "POST",
			url : contextPath+"/createQrcode.action",
			async : false,//同步请求
			success : function(data) {
				$("#imgQr").attr("src","https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + data);
				$("#ticket").val(data);
				
				loginTime = setInterval(queryUserInfo,2000);
			}
		});	
	}
}
/*账号登录与微信扫码登录间的切换*/
$(".modify_doubleTit span").click(function() {
	var index = $(this).parent("h1").index();
	$(this).parent("h1").addClass("current").siblings().removeClass("current");
	createCode();
	
	//切换层
	$('.mix_he').css({'border':'none'});
	$(".changeTab:eq("+ index +")").removeClass("modify_none").siblings(".changeTab").addClass("modify_none");
});

var count = 60;

//获取扫描后二维码信息
function queryUserInfo(){
	var ticket = $("#ticket").val();
	
	$.ajax( {
		type : "POST",
		url : contextPath+"/queryUserInfo.action",
		async : false,
		data:{"ticket":ticket},
		success : function(data) {
			if(data == "codeIsSuccess"){//扫描二维码成功
				 clearInterval(loginTime);
				 loginTime=null;
				//跳转到输入手机号页面
				$(".modify_loading").show();
				$(".changeTab:eq(2)").show().siblings(".changeTab").hide();
				$(".modify_doubleTit").hide().siblings(".modify_singleTit").show().find("h1").eq(0).show();//显示输入手机号页面
				
			}else if(data.indexOf("loginSuccess") == 0){
				//location.href = $("serviceUrl").val();
				 clearInterval(loginTime);
				 loginTime=null;
				wechatFlag = 1;
				var dataArr = data.split(",");
				$('#telphone').val(dataArr[1]);
				$('#password').val(dataArr[2]);
				$('#loginForm').submit();
			}else if(data == "codeIsExpires"){
				 clearInterval(loginTime);
				 loginTime=null;
				$(".modify_loading").hide().siblings(".modify_codeFail").show();
			}else if(data == "error"){
				alert("系统异常，请刷新页面...");
			}else{
				if (count > 0) {
                    // 3秒后继续调用定时器
                    count--;
                } else {
                    // 超时。 清除定时器
                    clearInterval(loginTime);
                    loginTime=null;
                    $(".modify_loading").hide().siblings(".modify_codeFail").show();
                }
				//$(".modify_loading").hide();
			}
		},
		error : function(){
			clearInterval(loginTime);
			loginTime=null;
		}
	});	
}

/*点击下一步,如果sign = 0,未注册，sign = 1,已注册*/
$("#nextBtn").click(function() {
	var ticket = $("#ticket").val();
	var bindingMobile = $("#bindingMobile").val();
	if(checkMobile()){
		$.ajax( {
			type : "POST",
			url : contextPath+"/selectUserByMobile.action",
			async : false,//同步请求
			data:{"mobile":bindingMobile,"ticket":ticket},
			success : function(data) {
				if(data != null){
					var dataArr = data.split(",");
					if(data.indexOf("oldUser") == 0){
						//已注册 登陆页
						$(".phoneNum").hide();
						$("#loginUserDiv").show();
						$("#telphone").val(dataArr[1]);
					}else if(data.indexOf("newUser") == 0){
						//未注册 注册页
						$(".phoneNum").hide();
						$("#loginDiv").hide();
						$("#registorDiv").show();
						$("#mobile").val(dataArr[1]);
					}else if(data == "error"){
						
					}
				}
				
			}
		});	
	}
});

$(".modify_codeFail a").click(function() {
	$(".modify_mask").hide();
	createCode();
});

function checkMobile(){
	var mobile = $("#bindingMobile").val();
	//validate Mobile  
	var telReg = /^(0|86|17951)?(13[0-9]|15[012356789]|17[0678]|18[0-9]|14[57])[0-9]{8}$/;
	//如果手机号码不能通过验证
	if(mobile.length == 0){
		$("#tips").show();
		$("#tips span").text("请输入手机号码");
		$("#bindingMobiel").focus();  
		return false;
	}else{
		if(!telReg.test(mobile)){
			$("#tips").show();
			$("#tips span").text("请输入正确的手机号码");
			$("#bindingMobiel").focus();  
			return false;
		}
	}
	return true;
}
$(function() {
	$("#bindingMobile").on("keypress",function(){
		$("#tips").hide();
		  $("#tips span").text("");
	});
});







</script>

</html>



